-
Notifications
You must be signed in to change notification settings - Fork 751
fix(stepfunctions): Remove and replace legacy render graph commands with workflow studio #6649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(stepfunctions): Remove and replace legacy render graph commands with workflow studio #6649
Conversation
|
…ith workflow studio
02fdd1f to
b467251
Compare
|
|
||
| const textEditor = await vscode.window.showTextDocument(doc) | ||
| await previewStateMachineCommand.execute(textEditor) | ||
| await vscode.commands.executeCommand( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be missing something but why can't you use the previewStateMachienCommand.execute here still? You should be able to pass in the URI now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it may be helpful to enhance openTextDocument as needed:
| export async function openTextDocument(filenameGlob: vscode.GlobPattern): Promise<vscode.TextDocument | undefined> { |
instead of calling 'vscode.openWith' directly. That allows us to (potentially) instrument that or improve it in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be missing something but why can't you use the previewStateMachienCommand.execute here still? You should be able to pass in the URI now
I initially tried to use previewStateMachineCommand.execute directly, however since I now call downloadStateMachineDefinition directly in the previewStateMachineCommand, it creates a circular dependency which fails the build.
Also, it may be helpful to enhance
openTextDocumentas needed:
export async function openTextDocument(filenameGlob: vscode.GlobPattern): Promise<vscode.TextDocument | undefined> { instead of calling
'vscode.openWith'directly. That allows us to (potentially) instrument that or improve it in the future.
I think openTextDocument is not quite the interface we want to use/overload, since it seems to primarily be used for searching for a file to open, while in this case we want to open a specific URI.
I can instead refactor out vscode.openWith(uri, WorkflowStudioEditorProvider.viewType, ...) however, since we have been repeating that pattern a few times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can instead refactor out
vscode.openWith(uri, WorkflowStudioEditorProvider.viewType, ...)however, since we have been repeating that pattern a few times.
🚀
|
Are there assets like https://github.com/aws/aws-toolkit-vscode/blob/cc0455f112c3be8db3232acfb777341f3225c557/packages/core/resources/js/graphStateMachine.js that we can drop , as part of this PR? |
Not yet, it is still in use by the CDK graph visualization command |
624740f
into
aws:feature/stepfunctions-workflow
Problem
After this PR removing the legacy graph, there were still some components of the old graph which were not removed/replaced properly causing some bugs:
aws.previewStateMachinecommand in command palette has an invalid translation.aws.previewStateMachinecommand throws an error when used from the command palette.aws.stepfunctions.openWithWorkflowStudiocommand (which is used for opening WFS with the context menu) throws an error when used from the command palette.aws.renderStateMachineGraphin the AWS explorer for state machines throws an error.Solution
previewStateMachinetranslation withopenWithWorkflowStudio.previewStateMachinecommand when passing tovscode.openWith.aws.stepfunctions.openWithWorkflowStudioin the command palette (Theaws.previewStateMachinecommand already works).aws.renderStateMachineGraph, and just re-usepreviewStateMachinefor the explorer nodes as well.feature/xbranches will not be squash-merged at release time.